United States patent application US2003/0200448 describes an example of an integrated device coupled to a non-volatile memory for securely storing data. The device comprises a processor and an access control unit, the access control unit having a memory interface to the memory and a processor interface to the processor. Various security functions are implemented in the access unit, such as an encryption and decryption function. The processor has a data cache and an instruction cache for storing clear data. When the processor writes clear data to the cache, such data has to be stored in encrypted form in the non-volatile memory later. In the later write process, clear data is read from the cache and transferred to the access control unit via the processor interface. The access unit subsequently performs data encryption, and the writes the encrypted data to a secure memory region in the memory via the memory interface.